import { InteractionSelectAction, InteractionSelectActionTypes } from "../actions/interaction-select.action";



export interface InteractionSelectState {
    active: boolean
};

export const initialInteractionSelectState: InteractionSelectState = {
    active: true
};

export function interactionSelectReducer(
    state: InteractionSelectState = initialInteractionSelectState,
    action: InteractionSelectAction
): InteractionSelectState {
    switch(action.type) {
        case InteractionSelectActionTypes.INTERACTION_SELECT_ACTIVE: {
            return {
                ...state,
                active: true
            }
        }
        case InteractionSelectActionTypes.INTERACTION_SELECT_DEACTIVE: {
            return {
                ...state,
                active: false
            }
        }
        default: {
            return state;
        }
    }
}